const installer = require('./')
const path = require('path')

// amd64
// arm64
// mips64el
const arch = "mips64el"
const ywmc = 'com.tfswx.zhijian'
const zwmc = '智检'
const options = {
  target: "rpm",
  pkg: {
    name: "zhijian",
    version: "1.3.5"
  },
  src: path.resolve(__dirname, `linux-mips64el-unpacked`),
  dest: path.resolve('dist', 'installers/'),
  arch: arch,
  name: ywmc,
  // 描述
  description: zwmc,
  // 安装时显示的描述
  productDescription: `${zwmc} 安装程序`,
  productName: zwmc,
  categories: ['Application'],
  authors: ['tfswx'],
  scripts: {
    // 'preinst': 'resources/preinst_script',
    postinst: `postinst`
    // 'prerm': 'resources/prerm_script',
    // 'postrm': 'resources/postrm_script'
  },
  icon: {
    '16x16': `linux-mips64el-unpacked/icons/16.png`,
    '24x24': `linux-mips64el-unpacked/icons/24.png`,
    '32x32': `linux-mips64el-unpacked/icons/32.png`,
    '48x48': `linux-mips64el-unpacked/icons/48.png`,
    // '64x64': `linux-mips64el-unpacked/icons/64.png`,
    '128x128': `linux-mips64el-unpacked/icons/128.png`,
    '256x256': `linux-mips64el-unpacked/icons/256.png`,
    '512x512': `linux-mips64el-unpacked/icons/512.png`,
    // scalable: `linux-mips64el-unpacked/icons/scalable.svg`
  },
  // startFilePath: "/opt/apps/com.tfswx.xunwen-jietu/files/start.sh",
  // desktopIcon: "/opt/apps/com.tfswx.xunwen-jietu/files/icon/128.png",
}

console.log('开始打包')
// eslint-disable-next-line promise/catch-or-return,promise/always-return
installer(options).then((opts) => {
  console.log('打成安装包成功\n', opts)
})
